{% form_theme form 'UserBundle:Form:fields.html.twig' %}

{% if images|length < 10 %}
	<form novalidate="" class="custom formulario" action="{{ url('user_edit_fotos') }}" method="post" {{ form_enctype(form) }}>
		{% for flashMessage in app.session.flashbag.get('notice-Image') %}
			<div data-alert="" class="alert-box success">
				{{ flashMessage }}
				<a href="" class="close">×</a>
			</div>

		{% endfor %}

		{% for flashMessage in app.session.flashbag.get('error-Image') %}
			<div data-alert="" class="alert-box alert">
				{{ flashMessage }}
				<a href="" class="close">×</a>
			</div>

		{% endfor %}

		{{ form_widget(form) }}

		<div class="row">
			<div class="seven offset-by-five columns">
				<button type="submit" class="button radius"><i class="icon-save"></i> &nbsp;Agregar</button>
			</div>
		</div>
	</form>
{% endif %}


<div class="images">
	{% for image in images %}
		<div class="six columns">
			<div class="msg msg_{{ image.id }}"></div>
			<div class="search-item">
				<div class="avatar">
					<img src="{{ image.getWebPath | imagine_filter('small')}}" alt="Avatar">
				</div>
				<div class="search-body">
					<p>
						<input placeholder="Descripción" type="text" id="img_nombre_{{ image.id }}" name="Image_nombre" value="{{ image.nombre }}"/>
					</p>
				</div>
				<p>
					<a href="javascript:void(0);" onclick="guardarImg({{ image.id }})" class="small button radius"><i class="icon-save"></i> Guardar</a>
					<a href="javascript:void(0);" onclick="predeterminarImg({{ image.id }})" class="small button radius secondary"><i class="icon-check"></i> Predeterminar</a>
					<a href="javascript:void(0);" onclick="borrarImg({{ image.id }})" class="small button radius alert"><i class="icon-remove"></i> Borrar</a>
				</p>
			</div>
		</div>
	{% endfor %}
</div>

